/*
 * @Author: 赛罗
 * @Date: 2023-10-25 11:19:42
 * @LastEditors: 狸猫
 * @LastEditTime: 2024-05-08 14:56:54
 * @FilePath: \haixiaoke-enterprise-reconstruction\src\api\house\unmount.js
 * @Description:
 */
import request from "@/utils/request";

// 统计上下架数据
export function housingAllocationStatistics(query) {
  return request({
    url: "/enterprise/house/housingAllocation/statistics",
    method: "get",
    params: query,
  });
}
// 统计数据tab
export function countByState(query) {
  return request({
    url: "/enterprise/apartment/allocation/countByState",
    method: "get",
    params: query,
  });
}

// 查询上下架列表
export function allocationList(query) {
  return request({
    url: "/enterprise/apartment/allocation/list",
    method: "get",
    params: query,
  });
}

// 查询已配置房屋信息
export function listByAllocation(query) {
  return request({
    url: "/enterprise/apartment/allocation/listByAllocation",
    method: "get",
    params: query,
  });
}


// 查询房屋配置列表
export function listHousingAllocation(query) {
  return request({
    url: "/enterprise/house/housingAllocation/list",
    method: "get",
    params: query,
  });
}

// 查询退订规则列表
export function unsubscribeRule(query) {
  return request({
    url: "/enterprise/apartment/unsubscribeRule/list",
    method: "get",
    params: query,
  });
}


// 获取房屋配置详细信息（路径传房屋id）
export function getAllocation(id) {
  return request({
    url: "/enterprise/apartment/allocation/" + id,
    method: "get",
  });
}

// 查询房屋设施集合
export function listFacilities(query) {
  return request({
    url: "/enterprise/apartment/facilities/list",

    method: "get",
    params: query,
  });
}

// 查询房屋设施集合new
export function getfacilities(query) {
  return request({
    url: "/enterprise/apartment/facilities/list ",
    method: "get",
    params: query,
  });
}
// 查询热门景点集合
export function listAttractions(query) {
  return request({
    url: "/enterprise/apartment/attractions/list",
    method: "get",
    params: query,
  });
}
// 查询价格区间列表
export function listRange(query) {
  return request({
    url: "/enterprise/order/range/list",
    method: "get",
    params: query,
  });
}
// 查询商业区列表
export function listCircle(query) {
  return request({
    url: "/enterprise/apartment/circle/list",
    method: "get",
    params: query,
  });
}
// 查询种类列表
export function requireList(query) {
  return request({
    url: "/enterprise/apartment/require/list",
    method: "get",
    params: query,
  });
}

// 查询装修情况列表
export function listDecoration(query) {
  return request({
    url: "/enterprise/house/decoration/list",
    method: "get",
    params: query,
  });
}

//   获取机构下的房屋标签
export function getAllInfoLabel() {
  return request({
    url: "/enterprise/apartment/label/getAllInfo",
    method: "get",
  });
}

//查询押付方式列表
export function listPayType(){
  return request({
    url:"/enterprise/order/payType/list",
    method:"get"
  })
}

//修改房屋上下架状态
export function changeApartmentStateStatus(allocationId) {
  const data = {
    allocationId,
  };
  return request({
    url: "/enterprise/apartment/allocation/edit/state",
    method: "put",
    data: data,
  });
}

// 修改房屋配置
export function updateHousingAllocation(data) {
  return request({
    url: "/enterprise/apartment/allocation",
    method: "put",
    data: data,
  });
}

// 新增房屋配置
export function addHousingAllocation(data) {
  return request({
    url: "/enterprise/apartment/allocation",
    method: "post",
    data: data,
  });
}

// 新增房屋标签
export function addLabel(data) {
  return request({
    url: "/enterprise/house/label",
    method: "post",
    data: data,
  });
}
